import { axios } from '@/utils/request'

const api = {
    getSetting: '/imageSearch/image-search/get-setting',
    saveSetting: '/imageSearch/image-search/save-setting',
    storeSetting: '/imageSearch/image-search/store-setting',
    uploadImage: '/imageSearch/image-search/upload-image',
    refreshImageGroup: '/imageSearch/image-search/refresh-image-group',
    getErrImage: '/imageSearch/image-search/get-err-image',
}

export default api

export function getSetting (parameter) {
  return axios({
    url: api.getSetting,
    method: 'get',
    params: parameter
  })
}

export function saveSetting (parameter) {
  return axios({
    url: api.saveSetting,
    method: 'post',
    data: parameter
  })
}

export function getStoreSetting (parameter) {
  return axios({
    url: api.storeSetting,
    method: 'get',
    params: parameter
  })
}

export function saveStoreSetting (parameter) {
  return axios({
    url: api.storeSetting,
    method: 'post',
    data: parameter
  })
}

export function uploadImage (parameter) {
  return axios({
    url: api.uploadImage,
    method: 'get',
    params: parameter
  })
}

export function refreshImageGroup (parameter) {
  return axios({
    url: api.refreshImageGroup,
    method: 'get',
    params: parameter
  })
}

export function getErrImage (parameter) {
  return axios({
    url: api.getErrImage,
    method: 'get',
    params: parameter
  })
}